/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2017
 */

package com.shop.pandian.app.model;

import java.sql.Timestamp;

import javax.persistence.*;

import org.hibernate.annotations.Cascade;
import org.hibernate.validator.constraints.*;

import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.validation.constraints.*;

import com.shop.pandian.framework.base.dao.BaseUpdatableEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * @author Xi Wei
 * @version 1.0
 * @since 1.0
 */
 @Entity
@Table(name = "product")
public class Product extends BaseUpdatableEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;

	


	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	@NotBlank @Length(max=100)
	@Column(name = "product_name", unique = false, nullable = false, insertable = true, updatable = true, length = 100)
	private java.lang.String productName; //productName
	
	@Length(max=255)
	@Column(name = "product_desc", unique = false, nullable = true, insertable = true, updatable = true, length = 255)
	private java.lang.String productDesc; //productDesc
	
	@Length(max=255)
	@Column(name = "price", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	private java.lang.String price; //price
	
	
	
	//columns END



	
	
	
	public java.lang.String getProductName() {
		return this.productName;
	}
	
	public void setProductName(java.lang.String value) {
		this.productName = value;
	}

	public java.lang.String getProductDesc() {
		return this.productDesc;
	}
	
	public void setProductDesc(java.lang.String value) {
		this.productDesc = value;
	}

	public java.lang.String getPrice() {
		return this.price;
	}
	
	public void setPrice(java.lang.String value) {
		this.price = value;
	}




	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	@JoinColumns({
		@JoinColumn(name = "product_category_id") 
	})
	private ProductCategory productCategory;
	public void setProductCategory(ProductCategory productCategory){
		this.productCategory = productCategory;
	}

	@JsonIgnore
	public ProductCategory getProductCategory() {
		return productCategory;
	}

}

